﻿using MacIPChecker.Services;

namespace MacIPChecker;

public partial class MainPage : ContentPage
{
    private readonly IPAddressService _ipService;

    public MainPage()
    {
        InitializeComponent();
        _ipService = new IPAddressService();
    }

    protected override void OnAppearing()
    {
        base.OnAppearing();
        // 获取IP地址并绑定到UI
        var ipData = _ipService.GetActiveIPAddresses();
        ipCollectionView.ItemsSource = ipData;
    }
}